export default {
	namespaced: true,
	state: {
		//首页轮播
		homeSwider: JSON.parse(uni.getStorageSync('homeSwider') || '[]') || [], 
		
		cateSwider: JSON.parse(uni.getStorageSync('cateSwider') || '[]') || [], 
		
		
		//首页内页单页广告
		homeAd: JSON.parse(uni.getStorageSync('homeAd') || '[]') || [],
		
		//首页底部logo图片
		homeLogo : JSON.parse(uni.getStorageSync('homeLogo') || '{}') || {},
	},
	mutations: {
		setHomeSwider(state, data) {
			try{
				uni.setStorageSync('homeSwider', JSON.stringify(data))
				state.homeSwider = data
			}catch(e){
				console.log('用户数据错误')
			}
		},
		
		setCateSwider(state, data) {
			try{
				uni.setStorageSync('cateSwider', JSON.stringify(data))
				state.cateSwider = data
			}catch(e){
				console.log('用户数据错误')
			}
		},
		
		setHomeAd(state, data) {
			try{
				uni.setStorageSync('homeAd', JSON.stringify(data))
				state.homeAd = data
			}catch(e){
				console.log('用户数据错误')
			}
		},
		
		setHomeLogo(state, data) {
			try{
				uni.setStorageSync('homeLogo', JSON.stringify(data))
				state.homeLogo = data
			}catch(e){
				console.log('用户数据错误')
			}
		},
	},
	actions: {
		
	}
}